package frontend.parser.syntaxtree;

import frontend.lexer.TKType;
import frontend.parser.syntaxtree.symbol.NonTerminalSymbol;
import frontend.parser.syntaxtree.symbol.TerminalSymbol;

import java.util.function.Consumer;

public class RelExpNodeForDouble extends RelExpNode {
    public RelExpNode relExp;
    public TKType op;
    public AddExpNode addExp;

    @Override
    public void walk(Consumer<TerminalSymbol> terConsumer, Consumer<NonTerminalSymbol> nonTerConsumer) {
        relExp.walk(terConsumer, nonTerConsumer);

        terConsumer.accept(new TerminalSymbol(op));

        addExp.walk(terConsumer, nonTerConsumer);

        nonTerConsumer.accept(new NonTerminalSymbol(this));
    }
}
